#!/bin/sh

#挂载ysytem 
root_fs="UUID=93b266e8-f6bb-4661-86ab-45ea77ef5a38"
root_em="UUID=6224-3834"
echo "复制boot"

bootdir=/mnt/p1
rm -rfv $bootdir
mkdir -p $bootdir
echo "正在修复boot"
mount -o rw $root_em $bootdir
rm -rfv $bootdir/*

cp -rfv /boot/* $bootdir




#配置服务启动 /etc/supervisord.d/sshd.ini
cat > $bootdir/uEnv.txt << EOF 
LINUX=/zImage
INITRD=/uInitrd

FDT=/dtb/amlogic/meson-sm1-h96-max-x3-oc.dtb
APPEND=root=$root_fs rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0

EOF


sync

cat $dirfs/etc/fstab
cat $bootdir/uEnv.txt
